always import Utility.Process rather than System.Process
authorJoey Hess <joeyh@joeyh.name>
Wed, 10 Sep 2025 17:53:50 +0000 (13:53 -0400)
committerJoey Hess <joeyh@joeyh.name>
Wed, 10 Sep 2025 17:53:50 +0000 (13:53 -0400)
This is groundwork for Utility.Process doing some extra locking, for
which it's important that it's always used for process creation.

Annex/Multicast.hs
Build/Mans.hs
Build/Version.hs
Types/CleanupActions.hs
Utility/Process.hs

index bc3b2eb3f668313455148f5bb44723cf2098c796..0af2d888db9641a7a325bb60239be1808138e364 100644 (file)
@@ -11,7 +11,7 @@ import Common
 import Annex.Path
 import Utility.Env
 
-import System.Process
+import Utility.Process
 import GHC.IO.Handle.FD
 
 multicastReceiveEnv :: String
index 56183e30d688909717c514992efeffaf5a25bd73..3eec54c6dfc357e0298b3d4c8e8621ad1a6f0ae8 100644 (file)
@@ -13,8 +13,7 @@ import System.Directory
 import System.FilePath
 import Data.List
 import Control.Monad
-import System.Process
-import System.Exit
+import Utility.SafeCommand
 import Data.Maybe
 import Utility.Exception
 import Control.Applicative
@@ -37,16 +36,16 @@ buildMans = do
                destm <- catchMaybeIO $ getModificationTime dest
                if (Just srcm > destm)
                        then do
-                               r <- system $ unwords
-                                       -- Run with per because in some
-                                       -- cases it may not be executable.
-                                       [ "perl", "./Build/mdwn2man"
-                                       , progName src
-                                       , "1"
-                                       , src
-                                       , "> " ++ dest
+                               -- Run with perl because in some
+                               -- cases it may not be executable.
+                               r <- boolSystem "perl" $
+                                       [ Param "./Build/mdwn2man"
+                                       , Param $ progName src
+                                       , Param "1"
+                                       , Param src
+                                       , Param $ "> " ++ dest
                                        ]
-                               if r == ExitSuccess
+                               if r == True
                                        then return (Just dest)
                                        else return Nothing
                        else return (Just dest)
index 762714e89fe5e31f7b27937f3d568537d004f750..216f3133bb0d589478f0a3bc73bd1e8f3bc2ef0c 100644 (file)
@@ -8,7 +8,6 @@ module Build.Version where
 import Data.List
 import System.Environment
 import Data.Char
-import System.Process
 import Control.Applicative
 import Prelude
 
@@ -16,6 +15,7 @@ import Utility.Monad
 import Utility.Exception
 import Utility.OsPath
 import Utility.FileSystemEncoding
+import Utility.Process
 import qualified Utility.FileIO as F
 
 type Version = String
@@ -39,7 +39,7 @@ getVersion = do
                        gitversion <- takeWhile (\c -> isAlphaNum c) <$> readProcess "sh"
                                [ "-c"
                                , "git log -n 1 --format=format:'%H'"
-                               ] ""
+                               ]
                        return $ if null gitversion
                                then changelogversion
                                else concat
index 418472ef3eb3d12f9ba79a24f83b6cef5a98b711..a15917fc1e1391a08f6277e47bf05916c730b510 100644 (file)
@@ -10,7 +10,7 @@ module Types.CleanupActions where
 import Types.UUID
 import Utility.Url
 
-import System.Process (Pid)
+import Utility.Process (Pid)
 
 data CleanupAction
        = RemoteCleanup UUID
index f9dd94ec8ea970e1f9da2c579022d636bfe823c9..81fbef30bda2570fc760082d11a4717100e58ec7 100644 (file)
@@ -1,7 +1,7 @@
 {- System.Process enhancements, including additional ways of running
  - processes, and logging.
  -
- - Copyright 2012-2020 Joey Hess <id@joeyh.name>
+ - Copyright 2012-2025 Joey Hess <id@joeyh.name>
  -
  - License: BSD-2-clause
  -}
@@ -36,7 +36,7 @@ module Utility.Process (
 ) where
 
 import qualified Utility.Process.Shim
-import Utility.Process.Shim as X (CreateProcess(..), ProcessHandle, StdStream(..), CmdSpec(..), proc, getPid, getProcessExitCode, shell, terminateProcess, interruptProcessGroupOf)
+import Utility.Process.Shim as X (CreateProcess(..), ProcessHandle, StdStream(..), CmdSpec(..), proc, getPid, getProcessExitCode, shell, terminateProcess, interruptProcessGroupOf, Pid)
 import Utility.Misc
 import Utility.Exception
 import Utility.Monad